package models;

public class QueryBean {
	public long currentPage = 1;
	public int quantityEachPage = 10;
	//总页数，用于显示。
	public long totalPage;
	//总记录数，用于显示。
	public long totalQuantity;
	public String keyword;
	public String orderby;
	public boolean isDesc;
	
	public void pageCaculate() {
		if(currentPage == 0) currentPage = 1;
		totalPage = totalQuantity/quantityEachPage;
		if(totalQuantity%quantityEachPage > 0) totalPage++;
		if(totalPage < currentPage) {
			currentPage = totalPage;
		}
	}
}
